// CurveDrawer.h: interface for the CurveDrawer class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CURVEDRAWER_H__54B10E60_1FC7_4043_84F2_4FAFDE4D74BF__INCLUDED_)
#define AFX_CURVEDRAWER_H__54B10E60_1FC7_4043_84F2_4FAFDE4D74BF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define ROUND(v) (int)(v>=0?(v+.5):(v-.5))

class BaseMonitoringUnit;
class RealtimeRecordManager;

struct RealtimeCurveInfo
{
  RealtimeCurveInfo() {ZeroMemory(this, sizeof(RealtimeCurveInfo));}

  CRect m_rect;
  CTime m_timeBegin;
  CTime m_timeEnd;
  BaseMonitoringUnit * m_pMonitoringUnit;
  RealtimeRecordManager * m_pRealtimeRecordMgr;
  int m_nPenWidth;
  COLORREF m_crColor;
};

class CurveDrawer  
{
public:
	CurveDrawer();
	virtual ~CurveDrawer();

  void DrawCoordinateGrid(CDC& dc, RealtimeCurveInfo * pRealtimeCurveInfo);
  void DrawRealtimeCurve(CDC& dc, RealtimeCurveInfo * pRealtimeCurveInfo);

protected:
  void DrawTimeAxis(CDC& dc, const CRect& rect, const CTime& timeBegin, const CTime& timeEnd);
  void DrawDataAxis(CDC& dc, const CRect& rect, BaseMonitoringUnit * pMonitoringUnit);
};

#endif // !defined(AFX_CURVEDRAWER_H__54B10E60_1FC7_4043_84F2_4FAFDE4D74BF__INCLUDED_)
